package com.shuhan.controller;

import com.shuhan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * --- 万物归集  不随你我 ---
 * <p>
 * 快捷短语
 * main ==  public static void main(String[] args);
 * sout ==  System.out.println();
 *
 * @author shuhan
 * @date 2025/4/2
 * @desc
 */
@Controller // 控制层注解，同时兼顾接受请求和做出响应
public class Demo2UserController {

    @Autowired // 自动注入--自动给对象赋值
    UserService service;

    @RequestMapping("/user") // 映射前端
    public String findUser(){
        System.out.println("控制层运行...");
        service.findAll();
        return "index.html";
    }
}
